package com.example.bilibili.home;

import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.example.bilibili.R;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

public class FragmentB extends Fragment {

    private Context mContext;

    private ImageView p1;
    private ImageView p2;
    private ImageView p3;

    private static final String TAG = TuijianFragment.class.getSimpleName();


    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        mContext=getActivity();
        View view = inflater.inflate(R.layout.fragment_pinglun,container,false);
        p1 = (ImageView)view.findViewById( R.id.p1 );
        p2 = (ImageView)view.findViewById( R.id.p2 );
        p3 = (ImageView)view.findViewById( R.id.p3 );

        Bundle bundleb =this.getArguments();//得到从Activity传来的数据
        String Sp1 = null;
        String Sp2 = null;
        String Sp3 = null;
        if(bundleb!=null){
            Log.e(TAG, "收到数据");
            Sp1 = bundleb.getString("c1");
            Sp2 = bundleb.getString("c2");
            Sp3 = bundleb.getString("c3");
            Glide.with(mContext).load(Sp1).into(p1);
            Glide.with(mContext).load(Sp2).into(p2);
            Glide.with(mContext).load(Sp3).into(p3);

        }else{
            Log.e(TAG, "没有收到数据");
        }
        return view;
    }
}
